package com.chen.controller;

import com.chen.common.MyExpection;
import com.chen.common.Result;
import com.chen.service.ILoginService;
import com.chen.vo.login.LoginReqVO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;

/**
 * ClassName: LoginController
 * Package: com.chen.controller
 * Description:登录控制器
 *
 * @Author 陈俊辉
 * @Create 2024/4/12 2:30
 * @Version 1.0
 */
@RestController
@Tag(name = "后台管理-登录",description = "登录控制器")
@Validated
public class LoginController {
    @Resource
    public ILoginService loginService;

    @PostMapping("/login")
    @Operation(summary = "登录操作")
    public Result login(@Validated @RequestBody LoginReqVO reqVO, HttpServletResponse response) throws MyExpection {
       return loginService.login(reqVO,response);
    }
}
